package tech.aistar.day03;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 本类功能:后缀匹配注解中的路径第一个不用加 /
 *
 * @author cxylk
 * @date 2020/9/18 15:41
 */
@WebServlet(urlPatterns = "*.do")
public class SuffixAction extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PrintWriter out=resp.getWriter();

        //如何获取模糊的路径
        String pathInfo=req.getPathInfo();
        out.println(pathInfo);
        out.println("suffix");
    }
}
